package edu.cth.scrabbit.server.core;

import edu.cth.scrabbit.server.core.network.PlayerThread;
import edu.cth.scrabbit.shared.GameLetter;
import edu.cth.scrabbit.shared.Player;

/**
 * 
 * An interface for a player. Including methods as which gives the player
 * letters, remove letters, sets score and more.
 * 
 * @author Marcus Harryson, Anders Jonsson
 * 
 */

public interface IServerPlayer {
	/**
	 * A method that gives a letter to the server player.
	 * 
	 * @param letter
	 */
	public abstract void giveLetter(GameLetter letter);

	/**
	 * A method that removes a given letter from the server player. If the
	 * server player has more than one of the game letter, the first one will be
	 * removed
	 * 
	 * @param letter
	 */
	public abstract void removeLetter(GameLetter letter);

	/**
	 * A method that returns the player thread associated with the server
	 * players * @return
	 */
	public abstract PlayerThread getThread();

	/**
	 * A method that gives a list with the server players game letters.
	 * 
	 * @return
	 */

	public abstract GameLetter[] getLetters();

	/**
	 * A method that sets server players score
	 * 
	 * @param newScore
	 */
	public abstract void setScore(int newScore);

	/**
	 * A method that adds newPoints to the server player's old points.
	 * 
	 * @param newPoints
	 */
	public abstract void givePoints(int newPoints);

	/**
	 * A method that gives a player of a server player
	 * 
	 * @return
	 */
	public abstract Player toPlayer();

}